package pc

import (
	"hft/Http/Services/front/pc/app_res"
	utils "hft/Http/Utils"
	"hft/e"
	"strconv"

	"github.com/gin-gonic/gin"
)

type Index struct{}

func (*Index) GetIndex(c *gin.Context) {
	city, _ := strconv.Atoi(c.Request.Header.Get("sid"))
	if city == 0 {
		utils.FailWithMessage(e.NoManagerHere, c)
		return
	}
	index, _ := app_res.IndexService.GetIndex(city)
	utils.OkWithData(index, c)
}

var IndexController = new(Index)
